<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book reacjs开发 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Refs操作元素，文件上传 | reacjs开发</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
    

        
    
    
    <link rel="next" href="../002day/section06.html" />
    
    
    <link rel="prev" href="../002day/section04.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.5"
        data-chapter-title="Refs操作元素，文件上传"
        data-filepath="002day/section05.md"
        data-basepath=".."
        data-revision="Sun Feb 16 2020 11:31:01 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="001day/index.html">
            
                
                    <a href="../001day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        react入门
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="001day/section01.html">
            
                
                    <a href="../001day/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        react介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="001day/section02.html">
            
                
                    <a href="../001day/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        快速开始
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="001day/section03.html">
            
                
                    <a href="../001day/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        JSX语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="001day/section04.html">
            
                
                    <a href="../001day/section04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        函数组件和参数props
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="001day/section05.html">
            
                
                    <a href="../001day/section05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        ES6语法之类和类的继承
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="001day/section06.html">
            
                
                    <a href="../001day/section06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        类组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="001day/section07.html">
            
                
                    <a href="../001day/section07.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        绑定事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="001day/section08.html">
            
                
                    <a href="../001day/section08.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        状态(state)
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="002day/index.html">
            
                
                    <a href="../002day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        react进阶
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="002day/section01.html">
            
                
                    <a href="../002day/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        新增数组方法、属性表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="002day/section02.html">
            
                
                    <a href="../002day/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        列表渲染
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="002day/section03.html">
            
                
                    <a href="../002day/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        条件渲染
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="002day/section04.html">
            
                
                    <a href="../002day/section04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        表单数据绑定
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.5" data-path="002day/section05.html">
            
                
                    <a href="../002day/section05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        Refs操作元素，文件上传
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="002day/section06.html">
            
                
                    <a href="../002day/section06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        生命周期方法
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="003day/index.html">
            
                
                    <a href="../003day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        脚手架开发
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="003day/section01.html">
            
                
                    <a href="../003day/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        yarn的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="003day/section02.html">
            
                
                    <a href="../003day/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        脚手架开发
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="004day/index.html">
            
                
                    <a href="../004day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        react高级
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="004day/section01.html">
            
                
                    <a href="../004day/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        js模块化开发
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="004day/section02.html">
            
                
                    <a href="../004day/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        数据传递
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="004day/section03.html">
            
                
                    <a href="../004day/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        拆分组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="004day/section04.html">
            
                
                    <a href="../004day/section04.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        组件children属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="004day/section05.html">
            
                
                    <a href="../004day/section05.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        props校验
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="004day/section06.html">
            
                
                    <a href="../004day/section06.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        props默认值
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="004day/section07.html">
            
                
                    <a href="../004day/section07.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        render-props模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="004day/section08.html">
            
                
                    <a href="../004day/section08.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        高阶组件(HOC)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="004day/section09.html">
            
                
                    <a href="../004day/section09.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.</b>
                        
                        组件更新机制及性能优化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.10" data-path="004day/section10.html">
            
                
                    <a href="../004day/section10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.10.</b>
                        
                        虚拟dom及diff算法
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="005day/index.html">
            
                
                    <a href="../005day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        react深入
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="005day/section01.html">
            
                
                    <a href="../005day/section01.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        react路由
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="005day/section02.html">
            
                
                    <a href="../005day/section02.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        redux
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="005day/section03.html">
            
                
                    <a href="../005day/section03.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        react-redux
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >reacjs开发</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="refs&#x64CD;&#x4F5C;&#x5143;&#x7D20;&#xFF0C;&#x6587;&#x4EF6;&#x4E0A;&#x4F20;">Refs&#x64CD;&#x4F5C;&#x5143;&#x7D20;&#xFF0C;&#x6587;&#x4EF6;&#x4E0A;&#x4F20;</h2>
<h4 id="refs&#x64CD;&#x4F5C;&#x5143;&#x7D20;">Refs&#x64CD;&#x4F5C;&#x5143;&#x7D20;</h4>
<p>&#x6709;&#x65F6;&#x5019;&#x8FD8;&#x662F;&#x9700;&#x8981;&#x8BBF;&#x95EE;dom&#x8282;&#x70B9;&#x7684;&#xFF0C;react&#x63D0;&#x4F9B;&#x4E86;Refs&#x65B9;&#x5F0F;&#xFF0C;&#x65B9;&#x4FBF;&#x6211;&#x4EEC;&#x8BBF;&#x95EE;dom&#x8282;&#x70B9;&#x3002;
Refs &#x662F;&#x4F7F;&#x7528; React.createRef() &#x521B;&#x5EFA;&#x7684;&#xFF0C;&#x5E76;&#x901A;&#x8FC7; ref &#x5C5E;&#x6027;&#x9644;&#x52A0;&#x5230; React &#x5143;&#x7D20;&#x3002;&#x5728;&#x6784;&#x9020;&#x7EC4;&#x4EF6;&#x65F6;&#xFF0C;&#x901A;&#x5E38;&#x5C06; Refs &#x5206;&#x914D;&#x7ED9;&#x5B9E;&#x4F8B;&#x5C5E;&#x6027;&#xFF0C;&#x4EE5;&#x4FBF;&#x53EF;&#x4EE5;&#x5728;&#x6574;&#x4E2A;&#x7EC4;&#x4EF6;&#x4E2D;&#x5F15;&#x7528;&#x5B83;&#x4EEC;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Myform</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span></span>{
    constructor(props){
        <span class="hljs-keyword">super</span>(props);
        <span class="hljs-keyword">this</span>.state = {};
        <span class="hljs-comment">// &#x5728;&#x7EC4;&#x4EF6;&#x521D;&#x59CB;&#x5316;&#x7684;&#x65F6;&#x5019;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;ref&#x5BF9;&#x8C61;</span>
        <span class="hljs-keyword">this</span>.myref = React.createRef();
    }
    <span class="hljs-comment">// &#x5728;&#x7EC4;&#x4EF6;&#x6302;&#x8F7D;&#x5230;&#x9875;&#x9762;&#x4E4B;&#x540E;&#x81EA;&#x52A8;&#x6267;&#x884C;&#x7684;&#x65B9;&#x6CD5;</span>
    componentDidMount(){
        <span class="hljs-comment">//console.log( this.myref.current );</span>
        <span class="hljs-comment">// &#x8BA9;&#x8F93;&#x5165;&#x6846;&#x83B7;&#x5F97;&#x7126;&#x70B9;</span>
        <span class="hljs-keyword">this</span>.myref.current.focus();
    }
    render(){
        <span class="hljs-keyword">return</span> (
            <span class="hljs-comment">// &#x5728;&#x6807;&#x7B7E;&#x4E2D;&#x901A;&#x8FC7;ref&#x5173;&#x8054;&#x521B;&#x5EFA;&#x7684;ref&#x5BF9;&#x8C61;</span>
            &lt;input type=<span class="hljs-string">&quot;text&quot;</span> ref={ <span class="hljs-keyword">this</span>.myref } /&gt;
        )
    }
}
ReactDOM.render(<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-title">Myform</span> /&gt;</span>,document.getElementById(&apos;root&apos;));
</span></code></pre>
<h4 id="&#x6587;&#x4EF6;&#x4E0A;&#x4F20;">&#x6587;&#x4EF6;&#x4E0A;&#x4F20;</h4>
<p>&#x6587;&#x4EF6;&#x4E0A;&#x4F20;&#x4F7F;&#x7528;&#x7684;&#x8868;&#x5355;&#x5143;&#x4EF6;&#x662F;&lt;input type=&quot;file&quot;&gt;&#xFF0C;&#x8FD9;&#x79CD;&#x8868;&#x5355;&#x5143;&#x4EF6;&#xFF0C;&#x5B83;&#x7684;&#x503C;&#x662F;&#x4E0D;&#x9002;&#x5408;&#x548C;&#x7EC4;&#x4EF6;&#x4E2D;&#x7684;state&#x8FDB;&#x884C;&#x7ED1;&#x5B9A;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x5C31;&#x4E0D;&#x7ED1;&#x5B9A;&#x503C;&#xFF0C;&#x800C;&#x662F;&#x901A;&#x8FC7;&#x83B7;&#x53D6;dom&#x8282;&#x70B9;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x64CD;&#x4F5C;&#x5B83;&#x7684;&#x503C;&#xFF0C;&#x83B7;&#x53D6;&#x8282;&#x70B9;&#x53EF;&#x4EE5;&#x7528;&#x4E0A;&#x9762;&#x7684;Refs&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x8FD9;&#x79CD;&#x6CA1;&#x6709;&#x548C;state&#x7ED1;&#x5B9A;&#x6570;&#x636E;&#x7684;&#x7EC4;&#x4EF6;&#x53EB;&#x505A;&#x975E;&#x53D7;&#x63A7;&#x7EC4;&#x4EF6;&#x3002;
&#x4E0B;&#x9762;&#x6F14;&#x793A;react&#x4E2D;&#x4F7F;&#x7528;axios&#x4E0A;&#x4F20;&#x6587;&#x4EF6;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Fileform</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span></span>{
    constructor(props){
        <span class="hljs-keyword">super</span>(props);
        <span class="hljs-keyword">this</span>.state = {
            picUrl:<span class="hljs-string">&apos;&apos;</span>
        }
        <span class="hljs-keyword">this</span>.myFile = React.createRef();
    }

    fnUpload=()=&gt;{
        <span class="hljs-keyword">let</span> file = <span class="hljs-keyword">this</span>.myFile.current.files[<span class="hljs-number">0</span>];
        <span class="hljs-keyword">let</span> fd = <span class="hljs-keyword">new</span> FormData();
        fd.append(<span class="hljs-string">&apos;pic&apos;</span>,file);

        axios.post(<span class="hljs-string">&apos;http://localhost:3000/upload&apos;</span>, fd, {
            responseType: <span class="hljs-string">&apos;text&apos;</span>           
        }).then(dat=&gt;{
            <span class="hljs-built_in">console</span>.log(dat.data);
            <span class="hljs-keyword">this</span>.setState({
                picUrl:dat.data
            })
        })
    }

    render(){
        <span class="hljs-keyword">return</span> (
            <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-title">div</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;file&quot;</span> <span class="hljs-attribute">name</span>=<span class="hljs-value">&quot;pic&quot;</span> <span class="hljs-attribute">ref</span>=<span class="hljs-value">{this.myFile}</span>  /&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;button&quot;</span> <span class="hljs-attribute">value</span>=<span class="hljs-value">&quot;&#x4E0A;&#x4F20;&#x56FE;&#x7247;&quot;</span> <span class="hljs-attribute">onClick</span>=<span class="hljs-value">{this.fnUpload}</span> /&gt;</span><span class="hljs-tag">&lt;<span class="hljs-title">br</span> /&gt;</span>
                {
                    this.state.picUrl &amp;&amp; <span class="hljs-tag">&lt;<span class="hljs-title">img</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">{&apos;http:</span>//<span class="hljs-attribute">localhost:3000</span>/&apos;+<span class="hljs-attribute">this.state.picUrl</span>} /&gt;</span>
                }
            <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        )</span>
    }
}
ReactDOM.render(<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-title">Fileform</span> /&gt;</span>,document.getElementById(&apos;root&apos;));
</span></code></pre>
<p>&#x548C;&#x4E0A;&#x9762;&#x914D;&#x5957;&#x7684;nodejs&#x7F16;&#x5199;&#x7684;&#x670D;&#x52A1;&#x5668;&#x7A0B;&#x5E8F;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;express&apos;</span>);
<span class="hljs-keyword">const</span> multer  = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;multer&apos;</span>);
<span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;fs&apos;</span>);
<span class="hljs-keyword">const</span> path = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;path&apos;</span>);

<span class="hljs-keyword">const</span> upload = multer({ dest: <span class="hljs-string">&apos;uploads/&apos;</span> })
<span class="hljs-keyword">const</span> app = express();

<span class="hljs-comment">// &#x8BBE;&#x7F6E;&#x8DE8;&#x57DF;</span>
app.use((req,res,next)=&gt;{
    res.set(<span class="hljs-string">&apos;Access-Control-Allow-Origin&apos;</span>,<span class="hljs-string">&apos;*&apos;</span>);
    next();
});

<span class="hljs-comment">// &#x8BBE;&#x7F6E;&#x9759;&#x6001;&#x8D44;&#x6E90;&#x6587;&#x4EF6;&#x5939;&#x4E3A;uploads&#x6587;&#x4EF6;&#x5939;</span>
app.use(express.static(<span class="hljs-string">&apos;uploads&apos;</span>));

app.get(<span class="hljs-string">&apos;/&apos;</span>,(req,res)=&gt;{
    res.send(<span class="hljs-string">&apos;Hello world!&apos;</span>);
});

app.post(<span class="hljs-string">&apos;/upload&apos;</span>, upload.single(<span class="hljs-string">&apos;pic&apos;</span>), <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">req, res, next</span>) </span>{
    <span class="hljs-comment">// &#x8BBE;&#x7F6E;&#x4FDD;&#x5B58;&#x7684;&#x6587;&#x4EF6;&#x548C;&#x4E0A;&#x4F20;&#x7684;&#x6587;&#x4EF6;&#x540D;&#x4E00;&#x6837;</span>
    fs.renameSync(req.file.path, path.join(<span class="hljs-string">&apos;uploads&apos;</span>, req.file.originalname));
    res.send(req.file.originalname);
});


app.listen(<span class="hljs-number">3000</span>,()=&gt;{
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;server start!&apos;</span>);
});
</code></pre>
<h4 id="&#x8BFE;&#x5802;&#x5B9E;&#x4F8B;">&#x8BFE;&#x5802;&#x5B9E;&#x4F8B;</h4>
<p>Todolist</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../002day/section04.html" class="navigation navigation-prev " aria-label="Previous page: 表单数据绑定"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../002day/section06.html" class="navigation navigation-next " aria-label="Next page: 生命周期方法"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/fontsettings.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontsettings":{"family":"sans","size":2,"theme":"white"},"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book reacjs开发 -->
</html>
